package com.example.easybuy.pojo;

import java.util.List;

/*
分页查询
 */
public class Page {

    //页面容量
    private int pageSize;
    //当前页数
    private int currentPageNo;
    //总页数
    private int totalPageCount;
    //总数据条数
    private int totalDataCount;
    //查询出来的数据
    private List dataList;

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentPageNo() {
        return currentPageNo;
    }

    public void setCurrentPageNo(int currentPageNo) {
        this.currentPageNo = currentPageNo;
    }

    public int getTotalPageCount() {
        return totalPageCount;

    }

    public void setTotalPageCount() {
        if (pageSize!=0){
            if (totalDataCount%pageSize==0){
                totalPageCount=totalDataCount/pageSize;
            }else {
                totalPageCount=(totalDataCount/pageSize)+1;
            }
        }
    }

    public int getTotalDataCount() {
        return totalDataCount;
    }

    public void setTotalDataCount(int totalDataCount) {
        this.totalDataCount = totalDataCount;
        setTotalPageCount();
    }

    public List getDataList() {
        return dataList;
    }

    public void setDataList(List dataList) {
        this.dataList = dataList;
    }
}
